/*
 * 服务集合
 */
import '../constant/globals.dart' as globals;
import './httpUtil.dart';

/*
 * 重置请求头 
 */
void resetHttpHeader() {
  DioManager.resetInstance();
}

/*
 * 用户登录服务
 */
Future userLogin(data) {
  return DioManager.getInstance()
      .post("${globals.httpUrl}/user/userLogin", data);
}

/*
 * 获取用户日志列表 
 */
Future getLogListServer(data) {
  return DioManager.getInstance()
      .get("${globals.httpUrl}/log/getLogList", data);
}

/*
 * 根据日志ID和用户ID删除每日日志数据 
 */
Future deleteLogByLogIdAndUserId(data) {
  return DioManager.getInstance()
      .post("${globals.httpUrl}/log/deleteLogByLogIdAndUserId", data);
}

/*
 * 获取所有项目
 */
Future getProDictionary(data) {
  return DioManager.getInstance()
      .get("${globals.httpUrl}/sys/getProDictionary", data);
}

/*
 * 每日日志填写
 */
Future addLog(data) {
  return DioManager.getInstance().post("${globals.httpUrl}/log/addLog", data);
}

/*
 * 根据用户ID和日志ID获取日志详情
 */
Future getLogByLogId(data) {
  return DioManager.getInstance()
      .get("${globals.httpUrl}/log/getLogByLogId", data);
}

/*
 * 每日日志填写
 */
Future editLog(data) {
  return DioManager.getInstance().post("${globals.httpUrl}/log/editLog", data);
}

/*
 * 获取团队日志列表
 */
Future getTeamLogListByUserId(data) {
  return DioManager.getInstance()
      .get("${globals.httpUrl}/team/getTeamLogListByUserId", data);
}

/*
 * 根据产品线获取用户
 */
Future getUsersByProTeam(data) {
  return DioManager.getInstance()
      .get("${globals.httpUrl}/user/getUsersByProTeam", data);
}
